#!/usr/bin/perl

use EBox;
use EBox::Global;

EBox::init();

my $module = $ARGV[0];

unless (defined($module)) {
	print "Usage: $0 module\n";
	exit 1;
}

my $global = EBox::Global->getInstance();

unless ($global->modExists($module)) {
	print "Module $module does not exist\n";
    exit 1;
}

my $mod = $global->modInstance($module);

unless ($mod->isa('EBox::Module::Service')) {
	print "Module $module is not a service\n";
    exit 1;
}

$mod->setConfigured(undef);
$mod->set('_serviceModuleStatus', 0);
